cmake_minimum_required (VERSION 3.2)

PROJECT(demo04)


FIND_PACKAGE(fmt REQUIRED)


if(ANDROID)
	# 设置去除未使用代码的链接flag
	# 可以手动的在链接选项中加入 strip参数
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -Wall -s -ffunction-sections -fdata-sections")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -Wall -s -ffunction-sections -fdata-sections")
endif(ANDROID)



## 头文件目录
INCLUDE_DIRECTORIES( 
	./
	../../libs/exthal

)

SET( YATE_MODULE_TARGET demo04)  ## ${YATE_MODULE_TARGET}

ADD_LIBRARY(${YATE_MODULE_TARGET} SHARED
    demo04.cpp
)

## 链接Yate库
TARGET_LINK_LIBRARIES( ${YATE_MODULE_TARGET} ${yate_engine_lib} fmt::fmt-header-only )

SET_PROPERTY(TARGET ${YATE_MODULE_TARGET} PROPERTY FOLDER "modules-demo")

## 设置插件的后缀为.yate 
SET_TARGET_PROPERTIES(${YATE_MODULE_TARGET} PROPERTIES SUFFIX ".yate")

SET_TARGET_PROPERTIES(${YATE_MODULE_TARGET} PROPERTIES PREFIX "")

INSTALL (TARGETS ${YATE_MODULE_TARGET} LIBRARY DESTINATION modules )

## 安装conf.d目录下文件
INSTALL(DIRECTORY conf.d 
		DESTINATION .
		PATTERN "CVS" EXCLUDE
        PERMISSIONS OWNER_WRITE OWNER_READ
                    GROUP_READ
		)
